<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@page import="com.hz.model.User"%>
<%@page import="com.hz.util.ParamUtil"%>
<%@page import="com.hz.control.UserControl"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<body>
<%
            request.setCharacterEncoding("utf-8");
            int uid = ParamUtil.getInt(request,"uid");
            User rootinfo = UserControl.getUserInformation(uid); 
            User user = new User();
            //user.setUsername(ParamUtil.getString(request,"username"));
            user.setStuNum(ParamUtil.getString(request,"stuNum"));
            user.setRealname(ParamUtil.getString(request,"realname",rootinfo.getRealname()));
            user.setSex(ParamUtil.getInt(request,"sex"));
            user.setTel(ParamUtil.getString(request,"tel",rootinfo.getTel()));
            user.setQq(ParamUtil.getString(request,"qq",rootinfo.getQq()));
            user.setEmail(ParamUtil.getString(request,"email",rootinfo.getEmail()));
            user.setStuLevel(ParamUtil.getInt(request,"stuLevel"));
            user.setDepartmentId(ParamUtil.getInt(request,"departmentId",rootinfo.getDepartmentId()));
            user.setMajorId(ParamUtil.getInt(request,"majorId",rootinfo.getMajorId()));
            user.setGrade(ParamUtil.getInt(request,"grade",rootinfo.getGrade()));
            user.setBirthday(ParamUtil.getString(request,"birthday",rootinfo.getBirthday()));
            user.setBirthPlace(ParamUtil.getString(request,"birthPlace",rootinfo.getBirthPlace()));
            user.setHobby(ParamUtil.getString(request,"hobby"));
            user.setAward(ParamUtil.getString(request,"award"));
            user.setVolunteerExp(ParamUtil.getString(request,"volunteerExp"));
            user.setIdCard(ParamUtil.getString(request,"idCard",rootinfo.getIdCard()));
            //user.setPicPath(request.getParameter("picPath"));
            System.out.println(user.getHobby());
            if(UserControl.updateUserBool(user,uid)){
            %>
            <script>
            alert("修改 成功");
            window.location.href="userinfo.jsp";
            </script>
            
            <%}else{%>
             <script>
            alert("修改 失败");
            history.go(-1);
            </script>
            <%
            
            }
 %>
</body>
</html>